package io.xiaojl.xj2ee.kit;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

import io.xiaojl.xj2ee.modules.sys.entity.SysUserEntity;

/**  
 * <p>Title: SessionKit</p>  
 *
 * <p>Description: </p>  
 *
 * @author jilong.xiao  
 * @date 2018年5月28日  
 */
public class SessionKit {

	public static SysUserEntity getCurrentUser() {
		try {
			Subject subject = SecurityUtils.getSubject();
			SysUserEntity su = (SysUserEntity) subject.getPrincipal();
			return su;
		} catch (Exception e) {
			System.out.println("==============");
		}
		return null;
	}
	
}
